<!--
 * @Author: ChunLai
 * @Date: 2023-08-21 15:34:51
 * @LastEditTime: 2024-09-11 15:09:11
 * @Description: 展示客户基本信息
 * @FilePath: \0.newInsure\src\views\form\components\CustomerInfoDesc.vue
-->
<template>
  <div class="user_infos_desc">
    <van-cell-group>
      <van-cell title="投保人">
        <div class="ftc9">
          <span>{{ applicant.name }}</span>
          <span>/{{ applicant.age }}周岁</span>
          <span>/{{ applicant.sex == "0" ? "男" : "女" }}</span>
          <span
            >/{{ applicant.socialInsuFlag == "Y" ? "有社保" : "无社保" }}
          </span>
          <div>{{ applicant.occupationCodeName }}</div>
        </div>
      </van-cell>
      <van-cell
        :title="`被保人${apiBbrMult.length > 1 ? `${index + 1}` : ''}`"
        v-for="(item, index) in apiBbrMult"
        :key="`bbr-${index}`"
      >
        <div class="ftc9" v-if="item.relationToAppnt == '4'">
          <span>本人</span>
        </div>
        <div class="ftc9" v-else>
          <span>{{ item.name }}</span>
          <span>/{{ item.age }}周岁</span>
          <span>/{{ item.sex == "0" ? "男" : "女" }}</span>
          <span>/{{ item.socialInsuFlag == "Y" ? "有社保" : "无社保" }} </span>
          <div>{{ item.occupationCodeName }}</div>
        </div>
      </van-cell>
    </van-cell-group>
    <div class="rule-warn-msg" v-html="ruleWarn" v-if="showRuleWarn"></div>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  name: "CustomerInfoDesc",
  data() {
    return {};
  },
  components: {},
  computed: {
    ...mapGetters({
      apiBbrMult: "insert/apiBbrMult",
      applicant: "insert/applicant",
      ruleWarn: "page/ruleWarn",
    }),
    showRuleWarn() {
      let res = false;
      if (
        this.ruleWarn &&
        this.apiBbrMult.length == 2 &&
        this.mainRiskCode == "110150"
      ) {
        res = true;
      }
      return res;
    },
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {},
};
</script>

<style lang="less" scoped>
.user_infos_desc {
  /deep/.van-cell__title {
    flex: none;
    width: 60px;
  }
  /deep/.van-cell__value {
    flex: none;
    width: calc(100% - 60px);
  }
}
</style>
